#include <bits/stdc++.h>
using namespace std;

float x;
int main() {
    cin >> x;

    if (x >= 0 && x < 5) {
        cout << fixed << setprecision(3) << (2.5 - x);
    } else if (x < 10) {
        cout << fixed << setprecision(3) << (2 - 1.5 * (x - 3) * (x - 3));
    } else {
        cout << fixed << setprecision(3) << (x / 2 - 1.5);
    }
    return 0;
}